use "..\data\0.5 votes_merged.dta"

* Create bins by pctyea
gen yea90100=.
gen yea8089=.
gen yea7079=.
gen yea6069=.
gen yea5059=.
replace yea90100=1 if pctyea>=0.9 & pctyea<=1
replace yea8089=1 if pctyea>=0.8 & pctyea<.9
replace yea7079=1 if pctyea>=0.7 & pctyea<.8
replace yea6069=1 if pctyea>=0.6 & pctyea<.7
replace yea5059=1 if pctyea>=0.5 & pctyea<.6
replace yea5059=1 if pctyea>0.4 & pctyea<=.5
replace yea6069=1 if pctyea>0.3 & pctyea<=.4
replace yea7079=1 if pctyea>0.2 & pctyea<=.3
replace yea8089=1 if pctyea>0.1 & pctyea<=.2
replace yea90100=1 if pctyea>=0 & pctyea<=.1
gen bin="90+" if yea90100==1
replace bin="80-89" if yea8089==1
replace bin="70-79" if yea7079==1
replace bin="60-69" if yea6069==1
replace bin="50-59" if yea5059==1

* Figure E4: Distribution of Nonunanimous Votes
histogram pctyea if pctyea<1, start(0) width(0.1) frequency scheme(vg_outc) fcolor(white) lcolor(black) graphregion(color(white)) xtitle(Percent Yea) xlabel(#10) ylabel(0(250)1000) legend(off)